﻿package com.tudou.home.controller
{
    import com.tudou.consts.*;
    import com.tudou.home.commands.*;
    import com.tudou.home.consts.*;
    import com.tudou.home.model.*;
    import com.tudou.home.view.*;
    import flash.geom.*;
    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.command.*;

    public class ViewCommand extends SimpleCommand
    {

        public function ViewCommand()
        {
            return;
        }// end function

        override public function execute(param1:INotification) : void
        {
            var _loc_3:Rectangle = null;
            var _loc_2:* = facade.retrieveMediator(ViewMediator.NAME) as ViewMediator;
            var _loc_4:* = param1.getBody();
            var _loc_5:* = PageInfo.getInstance();
            switch(param1.getName())
            {
                case ViewCommandSet.ENTER_FULLSCREEN_AND_RESIZE:
                {
                    _loc_5.viewState = ViewState.FULLSCREEN;
                    _loc_3 = PlayerConsts.FULLSCREEN_RECT;
                    _loc_2.goTransform(_loc_3.width, _loc_3.height, true);
                    break;
                }
                case ViewCommandSet.REAL_EXIT_FULLCREEN:
                {
                    _loc_5.viewState = PlayerConsts.expandStage == true ? (ViewState.EXPAND) : (ViewState.NORMAL);
                    break;
                }
                case ViewCommandSet.NORMALSCREEN_RESIZE:
                {
                    _loc_5.viewState = PlayerConsts.expandStage == true ? (ViewState.EXPAND) : (ViewState.NORMAL);
                    _loc_3 = PlayerConsts.NORMALSCREEN_RECT;
                    _loc_2.goTransform(_loc_3.width, _loc_3.height, false);
                    break;
                }
                case ViewCommandSet.EXPAND_STAGE:
                {
                    PlayerConsts.expandStage = _loc_4;
                    _loc_5.viewState = _loc_4 == true ? (ViewState.EXPAND) : (ViewState.NORMAL);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
